﻿using System;
using System.Collections.Generic;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;
using System.Linq;
using System.Web;
using System.Web.Profile;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Xml.Linq;
using MonitoringService;

namespace MonitoringServer
{
  //public class DozorUser : MembershipUser
  //{
  //  private int id;
  //  private int teamID;
  //  private string password;
  //  private string roles;


  //  public int ID
  //  {
  //    get { return id; }
  //    set { id = value; }
  //  }

  //  public int TeamID
  //  {
  //    get { return teamID; }
  //    set { teamID = value; }
  //  }



  //  public string Roles
  //  {
  //    get { return roles; }
  //    set { roles = value; }
  //  }

  //  public DozorUser()
  //  {
  //  }


  //  public DozorUser(int id, string userName, string email)
  //    : base("DzzrMembershipProvider", userName, null, email, null, null, false, false, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now)
  //  {
  //    this.id = id;
  //  }

  //  public DozorUser(DataRow rw)
  //    : base("DzzrMembershipProvider", Convert.ToString(rw["login"]), null, Convert.ToString(rw["Email"]), null, null, false, false, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now, DateTime.Now)
  //  {
  //    this.id = Convert.ToInt32(rw["ID"]);
  //    this.password = Convert.ToString(rw["Password"]);
  //    this.roles = Convert.ToString(rw["Roles"]);
  //    this.teamID = Convert.ToInt32(rw["TeamID"]);
  //  }


  //  ///<summary>
  //  ///Gets the password for the membership user from the membership data store.
  //  ///</summary>
  //  ///
  //  ///<returns>
  //  ///The password for the membership user.
  //  ///</returns>
  //  ///
  //  public override string GetPassword()
  //  {
  //    return password;
  //  }

  //  ///<summary>
  //  ///Updates the password for the membership user in the membership data store.
  //  ///</summary>
  //  ///
  //  ///<returns>
  //  ///true if the update was successful; otherwise, false.
  //  ///</returns>
  //  ///
  //  ///<param name="newPassword">The new password for the membership user.</param>
  //  ///<param name="oldPassword">The current password for the membership user.</param>
  //  ///<exception cref="T:System.ArgumentNullException">oldPassword is null.-or-newPassword is null.</exception>
  //  ///<exception cref="T:System.ArgumentException">oldPassword is an empty string.-or-newPassword is an empty string.</exception>
  //  public override bool ChangePassword(string oldPassword, string newPassword)
  //  {
  //    if(GetPassword()!= oldPassword)
  //      return false;
  //    using (SqlConnection cnn = Helper.Connection)
  //    {
  //      SqlCommand cmd = new SqlCommand("ChangePassword", cnn);
  //      cmd.Parameters.AddWithValue("@ID", id);
  //      cmd.Parameters.AddWithValue("@Password", password);
  //      cmd.ExecuteNonQuery();
  //    }
  //    return true;
  //  }

  //  public List<MembershipUser> Select()
  //  {
  //    int teamID = Convert.ToInt32(HttpContext.Current.Profile["TeamID"]);
  //    return DzzrMembershipProvider.Select(teamID);
  //  }

  //  public static void Delete(int id)
  //  {
  //    using (SqlConnection cnn = Helper.Connection)
  //    {
  //      SqlCommand cmd = new SqlCommand("DeleteUser", cnn);
  //      cmd.CommandType = CommandType.StoredProcedure;
  //      cmd.Parameters.AddWithValue("@ID", id);
  //      cmd.ExecuteNonQuery();
  //    }
  //  }


  //}
}
